<?php //include("html-includes/common/carousel.php"); ?>
<div class="col-md-12">
	<div class="row">
		<?php include("global-includes/breadcrumbs.php"); ?>

		<h1 class="sectionTitle"><?php echo $page["name"]; ?></h1>
		<div class="clearfix"></div>
		<ul class="uppercase">
			<?php foreach($categories as $category):?>
				<?php if($category["num_rows"] > 0): ?>
					<li>
						<a title="<?php echo $category["name"]?>" href="<?php echo site_url().$category["url"]; ?>" class="parent dropdown-toggle">
							<?php echo $category["name"]; ?>
						</a>
						
						<?php if(isset($category["children"]) && count($category["children"]) > 0): ?>
							<ul>
								<?php foreach($category["children"] as $subcategory):?>
									<?php if($subcategory["num_rows"] > 0):?>
										<li><a title="<?php echo $subcategory["name"]?>" href="<?php echo site_url().$subcategory["url"];?>">
											<?php echo $subcategory["name"]; ?>
											<?php $products = filter_products($subcategory["id"], false, null, null, "name", "asc", false, false); ?>
											<ul class="lowercase">
												<?php foreach($products as $product): ?>
														
														<li>
															<a href="<?php echo $product['url']?>" title="<?php echo $product["name"]?>"><?php echo $product["name"]; ?></a>
														</li>
													
												<?php endforeach;?>
											</ul>
										</a></li>
									<?php endif; ?>
								<?php endforeach; ?>
							</ul>
						<?php endif; ?>
						
					</li>
				<?php endif;?>	
			<?php endforeach;?>
		</ul>
		
		
		<ul>
		<?php foreach($site_pages as $sitePage):?>
			<?php if($sitePage["visible_in_sitemap"] == 1):?>
				<li><a href="<?php echo $sitePage["url"]; ?>" title="<?php echo $sitePage["name"];?>"><?php echo $sitePage["name"];?></a></li>
			<?php endif?>
		<?php endforeach;?>
		</ul>
	</div>
	
	<?php if(isset($page["images"]) && count($page["images"])>0): ?>
		<?php include("html-includes/common/page-gallery.php"); ?>
	<?php endif; ?>
</div>
